﻿@model SmartParking.Web.Models.ParkZonesModel
@{
    ViewBag.Title = "Parkings";
    var modelAsJSON = new HtmlString(new System.Web.Script.Serialization.JavaScriptSerializer().Serialize(Model));
}

@section HeaderScripts {
    <link rel="stylesheet" type="text/css" href="http://dev.jtsage.com/cdn/datebox/latest/jqm-datebox.min.css" />
    <link rel="stylesheet" type="text/css" href="http://dev.jtsage.com/cdn/simpledialog/latest/jquery.mobile.simpledialog.min.css" />
    <script type="text/javascript" src="http://dev.jtsage.com/cdn/datebox/latest/jqm-datebox.core.min.js"></script>
    <script type="text/javascript" src="http://dev.jtsage.com/cdn/datebox/latest/jqm-datebox.mode.calbox.min.js"></script>
    <script type="text/javascript" src="http://dev.jtsage.com/cdn/datebox/i18n/jquery.mobile.datebox.i18n.en_US.utf8.js"></script>
    <script type="text/javascript" src="http://dev.jtsage.com/cdn/simpledialog/latest/jquery.mobile.simpledialog2.min.js"></script>
}

<div data-role="collapsible-set" data-theme="b" data-content-theme="c">
    @using (Html.BeginForm("UpdateParking", "Manager"))
    {
        <div id="customerInfo" data-role="collapsible" data-collapsed="true">
            <h3>Información del parqueo</h3>
            <div data-role="fieldcontain">
                <div class="editor-label">
                    Parking # @Html.ValueFor(model => model.Parking.ParkingID)
                    @Html.HiddenFor(model => model.Parking.ParkingID)
                    @Html.HiddenFor(model => model.Parking.CustomerID)
                </div>
            </div>
            <div data-role="fieldcontain">
                <div class="editor-label">
                    @Html.DisplayNameFor(model => model.Parking.Name):
                </div>
                <div class="editor-field">
                    @Html.EditorFor(model => model.Parking.Name)
                    @Html.ValidationMessageFor(model => model.Parking.Name, String.Empty, new { @style = "font-size:10px; font-weight:bold; padding:2px; display:inline;color:red;" })
                </div>
            </div>
            <div data-role="fieldcontain">
                <div class="editor-label">
                    @Html.DisplayNameFor(model => model.Parking.LegalId):
                </div>
                <div class="editor-field">
                    @Html.EditorFor(model => model.Parking.LegalId)
                    @Html.ValidationMessageFor(model => model.Parking.LegalId, String.Empty, new { @style = "font-size:10px; font-weight:bold; padding:2px; display:inline;color:red;" })
                </div>
            </div>
            <div data-role="fieldcontain">
                <div class="editor-label">
                    @Html.DisplayNameFor(model => model.Parking.LegalName):
                </div>
                <div class="editor-field">
                    @Html.EditorFor(model => model.Parking.LegalName)
                    @Html.ValidationMessageFor(model => model.Parking.LegalName, String.Empty, new { @style = "font-size:10px; font-weight:bold; padding:2px; display:inline;color:red;" })
                </div>
            </div>
            <div data-role="fieldcontain">
                <div class="editor-label">
                    @Html.DisplayNameFor(model => model.Parking.BankAccount):
                </div>
                <div class="editor-field">
                    @Html.EditorFor(model => model.Parking.BankAccount)
                    @Html.ValidationMessageFor(model => model.Parking.BankAccount, String.Empty, new { @style = "font-size:10px; font-weight:bold; padding:2px; display:inline;color:red;" })
                </div>
            </div>
            <div data-role="fieldcontain">
                <div class="editor-label">
                    @Html.DisplayNameFor(model => model.Parking.Address):
                </div>
                <div class="editor-field">
                    @Html.EditorFor(model => model.Parking.Address)
                    @Html.ValidationMessageFor(model => model.Parking.Address, String.Empty, new { @style = "font-size:10px; font-weight:bold; padding:2px; display:inline;color:red;" })
                </div>
            </div>
            <div data-role="fieldcontain">
                <div class="editor-label">
                    @Html.DisplayNameFor(model => model.Parking.PhoneNumber):
                </div>
                <div class="editor-field">
                    @Html.EditorFor(model => model.Parking.PhoneNumber)
                    @Html.ValidationMessageFor(model => model.Parking.PhoneNumber, String.Empty, new { @style = "font-size:10px; font-weight:bold; padding:2px; display:inline;color:red;" })
                </div>
            </div>
            <input id="cmdSaveParking" type="submit" data-theme="c" data-icon="arrow-r" data-iconpos="right" value="Guardar">
        </div>
        <div id="parkingsInfo" data-role="collapsible" data-collapsed="false">
            <h3>Zonas de Parqueo
            </h3>
            <ul data-role="listview" data-divider-theme="b" data-inset="true">
                @foreach (var item in Model.ParkZones)
                {
                    <li data-theme="c">
                        @Html.ActionLink(item.Name, "ParkingZoneFares", new { zoneId = item.ParkZoneID, parkingId = item.ParkingID })<br />
                    </li>       
                }
            </ul>
            <a href="@Url.Action("ParkZone", new { id = Model.Parking.ParkingID })" data-role="button" data-theme="c">Crear</a>
        </div>
    }
</div>

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
